package com.datoucai.enums;

/**
 * 消息通知枚举
 */
public enum NotificationEnumType {
        COMMENT(1,"评论"),   // 评论
        LIKE(2,"回复评论"),      // 点赞
        FOLLOW(3,"点赞"),    // 关注
        REPLY(4,"关注"),    // 回复评论
        MENTION(5,"@提及"),    // @提及
        ;
        int code;
        String msg;

        NotificationEnumType(int code, String msg) {
                this.code = code;
                this.msg = msg;
        }

        public int getCode() {
                return code;
        }

        public String getMsg() {
                return msg;
        }


        public static NotificationEnumType getByCode(int code) {
                for (NotificationEnumType notificationEnumType : NotificationEnumType.values()) {
                        if (notificationEnumType.getCode() == code) {
                                return notificationEnumType;
                        }
                }
                return null;
        }
}